/*     */ package com.cr.business;
/*     */ 
/*     */ import com.cr.business.domain.CrLawyerInfo;
/*     */ import com.cr.business.domain.CrUser;
/*     */ import com.cr.business.service.ICrLawyerInfoService;
/*     */ import com.cr.business.service.ICrUserService;
/*     */ import com.cr.common.annotation.Log;
/*     */ import com.cr.common.core.controller.BaseController;
/*     */ import com.cr.common.core.domain.AjaxResult;
/*     */ import com.cr.common.core.page.TableDataInfo;
/*     */ import com.cr.common.enums.BusinessType;
/*     */ import com.cr.common.utils.poi.ExcelUtil;

import io.swagger.v3.oas.annotations.parameters.RequestBody;

/*     */ import java.util.List;
/*     */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.ui.ModelMap;
/*     */ import org.springframework.web.bind.annotation.GetMapping;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.PostMapping;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/business/lawyerInfo"})
/*     */ public class CrLawyerInfoController extends BaseController {
/*  35 */   private String prefix = "business/lawyerInfo";
/*     */   
/*     */   @Autowired
/*     */   private ICrLawyerInfoService crLawyerInfoService;
/*     */   
/*     */   @Autowired
/*     */   private ICrUserService userService;

/*     */   @Autowired
/*     */   private ICrUserService crUserService;
/*     */   
/*     */   @RequiresPermissions({"business:lawyerInfo:view"})
/*     */   @GetMapping
/*     */   public String lawyerInfo(ModelMap mmap) {
/*  46 */     CrUser user = new CrUser();
/*  47 */     user.setUserType(Integer.valueOf(1));
/*  48 */     mmap.put("userList", this.userService.selectCrUserList(user));
/*  49 */     return this.prefix + "/lawyerInfo";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:lawyerInfo:list"})
/*     */   @PostMapping({"/list"})
/*     */   @ResponseBody
/*     */   public TableDataInfo list(CrLawyerInfo crLawyerInfo) {
/*  60 */     startPage();
/*  61 */     List<CrLawyerInfo> list = this.crLawyerInfoService.selectCrLawyerInfoList(crLawyerInfo);
/*  62 */     return getDataTable(list);
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:lawyerInfo:export"})
/*     */   @Log(title = "律师信息", businessType = BusinessType.EXPORT)
/*     */   @PostMapping({"/export"})
/*     */   @ResponseBody
/*     */   public AjaxResult export(CrLawyerInfo crLawyerInfo) {
/*  74 */     List<CrLawyerInfo> list = this.crLawyerInfoService.selectCrLawyerInfoList(crLawyerInfo);
/*  75 */     ExcelUtil<CrLawyerInfo> util = new ExcelUtil(CrLawyerInfo.class);
/*  76 */     return util.exportExcel(list, "律师信息数据");
/*     */   }
/*     */   
/*     */   @GetMapping({"/add"})
/*     */   public String add(ModelMap mmap) {
/*  85 */     CrUser user = new CrUser();
/*  86 */     user.setUserType(Integer.valueOf(1));
/*  87 */     mmap.put("userList", this.userService.selectCrUserList(user));
/*  88 */     return this.prefix + "/add";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:lawyerInfo:add"})
/*     */   @Log(title = "律师信息", businessType = BusinessType.INSERT)
/*     */   @PostMapping({"/add"})
/*     */   @ResponseBody
/*     */   public AjaxResult addSave(CrLawyerInfo crLawyerInfo) {
/* 100 */     return toAjax(this.crLawyerInfoService.insertCrLawyerInfo(crLawyerInfo));
/*     */   }
/*     */   
/*     */   @GetMapping({"/edit/{lawyerId}"})
/*     */   public String edit(@PathVariable("lawyerId") Long lawyerId, ModelMap mmap) {
/* 109 */     CrLawyerInfo crLawyerInfo = this.crLawyerInfoService.selectCrLawyerInfoByLawyerId(lawyerId);
/* 110 */     mmap.put("crLawyerInfo", crLawyerInfo);
/* 112 */     CrUser user = new CrUser();
/* 113 */     user.setUserType(Integer.valueOf(1));
/* 114 */     mmap.put("userList", this.userService.selectCrUserList(user));
/* 115 */     return this.prefix + "/edit";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:lawyerInfo:edit"})
/*     */   @Log(title = "律师信息", businessType = BusinessType.UPDATE)
/*     */   @PostMapping({"/edit"})
/*     */   @ResponseBody
/*     */   public AjaxResult editSave(CrLawyerInfo crLawyerInfo) {
/* 127 */     return toAjax(this.crLawyerInfoService.updateCrLawyerInfo(crLawyerInfo));
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:lawyerInfo:remove"})
/*     */   @Log(title = "律师信息", businessType = BusinessType.DELETE)
/*     */   @PostMapping({"/remove"})
/*     */   @ResponseBody
/*     */   public AjaxResult remove(String ids) {
/* 139 */     return toAjax(this.crLawyerInfoService.deleteCrLawyerInfoByLawyerIds(ids));
/*     */   }

/*     */   @PostMapping({"/editDetail"})
            @ResponseBody
/*     */   public CrUser editDetail(@RequestBody CrLawyerInfo crLawyerInfo) {
/*  99 */     return this.crUserService.selectCrUserByUserId(crLawyerInfo.getUserId());
/*     */   }
/*     */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\classes\com.zip!\com\cr\business\CrLawyerInfoController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */